﻿using System.Collections.Generic;

using Foothill.Common;
using Foothill.Model;

namespace Foothill.Service.Session
{
    // a class that encapuslates data for a user session 
    public class UserContext
    {
        public string CultureName { set; get; }

        // constructor
        public UserContext()
        {
            // by default , the UIculture is set to ZH_CN
            CultureName = UICultureName.ZH_CN; 
        }
    }

    public class UserContextService : IUserContextService
    {
        private ISessionService _sessionService;

        // constructor
        public UserContextService(ISessionService sessionService)
        {
            _sessionService = sessionService;
        }

        // get UserContext data for the current user session from the session store.
        public UserContext GetCurrentUserContext()
        {
            return _sessionService.GetUserContext();
        }

        public void SaveUserContext(UserContext userContext)
        {
            _sessionService.SaveUserContext(userContext);
        }
    }
}
